package com.kyivmohyla.kma2.client.view.operator;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.kyivmohyla.kma2.client.presenter.operator.OperatorMainViewPresenter;
import com.kyivmohyla.kma2.client.view.common.OrderCellTableWidget;

public class OperatorMainView extends Composite implements OperatorMainViewPresenter.Display {
    private static OperatorMainViewUiBinder ourUiBinder = GWT.create(OperatorMainViewUiBinder.class);
    @UiField
    protected Button newOrder;
    @UiField
    protected Button importOrders;
    @UiField
    protected OrderCellTableWidget orderCellTable;

    @Inject
    public OperatorMainView() {
        initWidget(ourUiBinder.createAndBindUi(this));
    }

    @Override
    public HasClickHandlers getNewOrderButton() {
        return newOrder;
    }

    @Override
    public HasClickHandlers getImportOrdersButton() {
        return importOrders;
    }

    @Override
    public OrderCellTableWidget getOrderCellTable() {
        return orderCellTable;
    }

    public Widget asWidget() {
        return this;
    }

    interface OperatorMainViewUiBinder extends UiBinder<Widget, OperatorMainView> {
    }
}